package com.apestech.framework.run.modul;

import java.util.Vector;

import com.apestech.framework.run.callback.ThreadCallBackHandler;

/**
 * 单个方法调用内容，支持回调和类+方法名调用二种模式
 * @author hup
 *
 */
public class SingleParam {
	
	private String name;
	private String className;
	private String methodName;
	private Vector<Object> param=new Vector<Object>();
	private boolean callback=false;
	private ThreadCallBackHandler threadCallBackHandler;
	
	public void add(ThreadCallBackHandler threadCallBackHandler){
		this.threadCallBackHandler=threadCallBackHandler;
		this.callback=true;
	}
	
	public void add(String className, String methodName){
		this.className=className;
		this.methodName=methodName;
	}
	
	public void add(String className, String methodName, Object... params){
		this.className=className;
		this.methodName=methodName;
		int len=params.length;
		for(int i=0; i<len; i++){
			this.param.add(params[i]);
		}
	}

	public String getClassName() {
		return className;
	}

	public String getMethodName() {
		return methodName;
	}

	public Vector<Object> getParam() {
		return param;
	}

	public boolean isCallback() {
		return callback;
	}

	public ThreadCallBackHandler getThreadCallBackHandler() {
		return threadCallBackHandler;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

}
